#define  _CRT_SECURE_NO_WARNINGS
class Solution {
    void bfs(vector<int>& src, vector<int>& tmp, vector<int>& dst, int n)
    {
        if (n == 1)
        {
            dst.push_back(src.back());
            src.pop_back();
            return;
        }
        bfs(src, dst, tmp, n - 1);
        dst.push_back(src.back());
        src.pop_back();
        bfs(tmp, src, dst, n - 1);
    }
public:
    void hanota(vector<int>& A, vector<int>& B, vector<int>& C) {
        return bfs(A, B, C, A.size());
    }
};